@namespace "http://www.w3.org/1998/Math/MathML";

math {
    display: inline-block;
    line-height: initial;
}

mfrac {
    display: inline-block;
    vertical-align: -50%;
    text-align: center;

    &>:first-child {
        border-bottom: solid thin currentColor;
    }

    &>* {
        display: block;
    }
}

msub {
    &>:nth-child(2) {
        font-size: smaller;
        vertical-align: sub;
    }
}

msup {
    &>:nth-child(2) {
        font-size: smaller;
        vertical-align: super;
    }
}

munder, mover, munderover {
    display: inline-flex;
    flex-flow: column nowrap;
    vertical-align: middle;
    text-align: center;

    &>:not(:first-child) {
        font-size: smaller;
    }
}

munderover {
    &>:last-child { order: -1; }
}

mroot, msqrt {
    position: relative;
    display: inline-block;
    border-top: solid thin currentColor;  
    margin-top: 0.5px;
    vertical-align: middle;  
    margin-left: 1ch; 

    &:before {
        content: "";
        display: inline-block;
        position: absolute;
        width: 1ch;
        left: -1ch;
        top: -1px;
        bottom: 0;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 100' preserveAspectRatio='none'%3E%3Cpath d='m0,75 l5,0 l5,25 l10,-100' stroke='black' fill='none' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    }
}